package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkSpaceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.OverviewDishesVO;
import com.sky.vo.OverviewOrdersVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Api(tags = "工作空间管理")
@RequestMapping("/admin/workspace")
public class WorkSpaceController {

    @Autowired
    private WorkSpaceService workSpaceService;

    @GetMapping("/businessData")
    @ApiOperation("今日业务数据")
    public Result<BusinessDataVO> getBusinessData() {
       BusinessDataVO businessDataVO = workSpaceService.getBusinessData();
       return Result.success(businessDataVO);
    }

    @ApiOperation("查询订单管理数据")
    @GetMapping("/overviewOrders")
    public Result<OverviewOrdersVO> getOverviewOrders() {
        OverviewOrdersVO overviewOrdersVO = workSpaceService.getOverviewOrders();
        return Result.success(overviewOrdersVO);
    }

    @ApiOperation("查询菜品总览")
    @GetMapping("/overviewDishes")
    public Result<OverviewDishesVO> getOverviewDishes() {
        OverviewDishesVO overviewDishesVO = workSpaceService.getOverviewDishes();
        return Result.success(overviewDishesVO);
    }

    @ApiOperation("查詢套餐總覽")
    @GetMapping("/overviewSetmeals")
    public Result<OverviewDishesVO> getOverviewSetmeals() {
        OverviewDishesVO overviewDishesVO = workSpaceService.getOverviewSetmeals();
        return Result.success(overviewDishesVO);
    }
}
